<!DOCTYPE html>  
<html>  
<head>  
    <title>stomp</title>  

  
   <script src="http://cdn.sockjs.org/sockjs-0.3.min.js"></script>
    
    <script src="http://cdn.bootcss.com/stomp.js/2.3.3/stomp.js"></script>
  
                  <script type="text/javascript">  
      
					 var url = 'http://'+ window.location.host +'/email-server/webServer';
					
					
					var userId="123456";
					
					
					var socket = new SockJS(url);

					var stompClient = Stomp.over(socket);

					stompClient.connect('guest','guest', function(frame) {
						    setConnected(true);  
			                console.log('Connected: ' + frame);  
			                
			                
			                stompClient.subscribe('/topic/greetings', function(greeting){  
			                    showGreeting(JSON.parse(greeting.body).content);  
			                });  
			                // starting line.  
			                stompClient.subscribe('/app/macro',function(greeting){  
			                    alert(JSON.parse(greeting.body).content);  
			                    showGreeting(JSON.parse(greeting.body).content);  
			                }); // ending line. attention for addr '/app/macro' in client.   
					});
					
					
				</script>  
</head>  
<body>  
             
</body>  
</html> 